Rails.application.routes.draw do
  # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
  
  root to: 'posts#main'
  namespace :api do
    namespace :v1 do
      resources :posts, only: [:index, :show, :create, :update, :destroy], defaults: {format: :json}
    end
  end
  # Defines the root path route ("/")
  # root "articles#index"
end
